{% extends 'studentes/base.html' %}
{% block students_index %}
    {% load static %}

    <div>


        <div id="carouselExampleDark" class="carousel carousel-dark slide" data-bs-ride="carousel">
            <div class="carousel-indicators">
                <button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="0" class="active"
                        aria-current="true" aria-label="Slide 1"></button>
                <button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="1"
                        aria-label="Slide 2"></button>
                <button type="button" data-bs-target="#carouselExampleDark" data-bs-slide-to="2"
                        aria-label="Slide 3"></button>
            </div>
            <div class="carousel-inner">
                <div class="carousel-item active" data-bs-interval="10000">
                    <img src="{% static 'img/1024.jpg' %}" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>在线学习系统</h5>
                        <p>欢迎您来到我的在线学习系统</p>
                    </div>
                </div>
                <div class="carousel-item" data-bs-interval="2000">
                    <img src="{% static 'img/1024.jpg' %}" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>在线学习系统</h5>
                        <p>欢迎您来到学习系统!</p>
                    </div>
                </div>
                <div class="carousel-item">
                    <img src="{% static 'img/1024.jpg' %}" class="d-block w-100" alt="...">
                    <div class="carousel-caption d-none d-md-block">
                        <h5>在线学习系统</h5>
                        <p>欢迎您来到我的在线学习系统</p>
                    </div>
                </div>
            </div>
            <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleDark"
                    data-bs-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="visually-hidden">Previous</span>
            </button>
            <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleDark"
                    data-bs-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="visually-hidden">Next</span>
            </button>
        </div>
    </div>
    <br>
    <br>
    {#课程显示#}
    <div class="container">
        <h3 style="margin-left: 40px">我的课程</h3>
        <hr>
        {% load static %}
        {% for i in course %}


            {#    for 循环#}
            <div href="/students/kecheng/{{ i.course.id }}" class="row"
                 style="background-color: rgba(0,0,0,0.04);
                margin-top: 5px;
                text-decoration: none;
                color: black;
">
                <a href="/students/kecheng/{{ i.course.id }}" class="col-md-2"
                   style="width: 12rem;text-decoration: none;color: black">

                    <img style="margin-top: 5px;border-radius: 5px" src="/static/media/{{ i.course.photo }}" class="card-img-top"
                         alt="{{ i.course.photo }}">

                </a>
                <a class="col-md-8" href="/students/kecheng/{{ i.course.id }}"
                   style="text-decoration: none;color: black">

                    <p style="margin-top: 10px"><b>{{ i.course.name }}</b>
                        <br>

                        {{ i.course.introduction | slice:":80" }}
                        <br>

                        参加时间：{{ i.myTime | date }}
                        {{ i.myTime | time }}</p>
                </a>

                <div class="col-md-2 ">
                    <div class="row">
                        {#是否开启考试判断————————————————————#}
                        <a href="{% url 'students_exercises' i.course.id %}" style="margin-top: 35px;margin-left:35px;width: 120px" class="btn btn-outline-success ">
                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                 class="bi bi-layout-text-sidebar-reverse" viewBox="0 0 16 16">
                                <path d="M12.5 3a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h5zm0 3a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h5zm.5 3.5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 .5-.5zm-.5 2.5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1h5z"/>
                                <path d="M16 2a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2zM4 1v14H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h2zm1 0h9a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5V1z"/>
                            </svg>
                            &emsp;练习题
                        </a>


                    </div>
                </div>


            </div>
        {% endfor %}


        {#    #}


    </div>

{% endblock %}
